﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Web.Routing;
using TeamsPortal.Web.UI;
using System.Web.Mvc;
using TeamsPortal.Tests.Fakes;
using TeamsPortal.Web.Routing;
using System.Web;
using TeamsPortal.Web.Controllers;
using System.IO;
using System.Text.RegularExpressions;
using System.Security.AccessControl;
using TeamsPortal.Configuration;
using TeamsPortal.ServiceClient;
using TeamsPortal.Web.State;
using NUnit.Framework;

namespace TeamsPortal.Tests.Controllers
{
	[TestFixture]
	public class AdminControllerTest
	{
		//[TestMethod]
		//public void AdminController_Status_Test()
		//{
		//    AdminController controller = new AdminController();
		//    controller.ControllerContext = new FakeControllerContext(controller, "http://localhost/forums/");
		//    controller.Url = new UrlHelper(controller.ControllerContext.RequestContext);
		//    controller.Status();

		//    Assert.IsNotNull(controller.ViewData["Debug"]);
		//    Assert.IsNotNull(controller.ViewData["CustomErrors"]);

		//    Assert.IsNull(controller.ViewData["StatusError"]);
		//}


		//[TestMethod]
		//public void AdminController_TestFakes()
		//{
		//    //AdminController controller = new AdminController();
		//    //controller.ControllerContext = new FakeControllerContext(controller, "http://localhost/forums/");
		//    //controller.Url = new UrlHelper(controller.ControllerContext.RequestContext);
		//    //controller.AddTemplate();
		//    //string test = controller.ViewData["SampleUrl"].ToString();
		//    //Assert.IsNotNull(test);
		//    FakeHttpContext context = new FakeHttpContext("http://localhost/forums/");
		//    string physicalPath = context.Server.MapPath("~/Content/Templates/Sample/Template.html");
		//    Assert.IsTrue(File.Exists(physicalPath));

		//}

		//[TestMethod]
		//public void AdminController_ChopTemplate_Test()
		//{
		//    AdminController controller = new AdminController();
		//    controller.ControllerContext = new FakeControllerContext(controller, "http://localhost/forums/");
		//    controller.Url = new UrlHelper(controller.ControllerContext.RequestContext);

		//    int parts = controller.ChopTemplateFile(controller.ControllerContext.HttpContext.Server.MapPath("~/Content/Templates/Sample/Template.html"));
		//    Assert.IsTrue(parts > 1);
		//}

		//[TestMethod]
		//public void AdminController_TestAccessWrites()
		//{
		//    FakeHttpContext context = new FakeHttpContext("http://localhost/");
		//    DirectoryInfo directory = new DirectoryInfo(context.Server.MapPath("/content/templates/"));
		//}
	}
}
